<template>
  <div class="list_title">查询分析</div>
  <div class="map_list">
    <div>
      <div class="img_map_box" @click="showSpatial">
        <img src="@/assets/images/KJCX.png" alt="" />
        <div class="map_active" v-show="KJ_flag">
          <img src="@/assets/images/input-checked.png" alt="" />
        </div>
      </div>
      <div>空间查询</div>
    </div>
    <div style="margin-left: 10px">
      <div class="img_map_box" @click="showSpill">
        <img src="@/assets/images/MYFX.png" alt="" />
        <div class="map_active" v-show="Spill_flag">
          <img src="@/assets/images/input-checked.png" alt="" />
        </div>
      </div>
      <div>冒溢分析</div>
    </div>
    <div style="margin-left: 10px">
      <div class="img_map_box" @click="showJam">
        <img src="@/assets/images/SYFX.png" alt="" />
        <div class="map_active" v-show="Jam_flag">
          <img src="@/assets/images/input-checked.png" alt="" />
        </div>
      </div>
      <div>堵塞分析</div>
    </div>
  </div>
</template>

<script setup>
import {
  onMounted,
  ref,
  toRaw,
  defineComponent,
  reactive,
  watch,
  nextTick,
} from 'vue'
import { switchList5 } from '@/store/index'
const Spill_flag = ref(false)
const Jam_flag = ref(false)
const KJ_flag = ref(false)
// 控制空间查询显隐
let storeSpatial = switchList5()
// 空间查询方法
const showSpatial = () => {
  storeSpatial.queryBtn = true
  Spill_flag.value = false
  Jam_flag.value = false
  KJ_flag.value = !KJ_flag.value
  if (KJ_flag.value == false) {
    storeSpatial.queryBtn = false
  }
}
watch(storeSpatial, () => {
  if (toRaw(storeSpatial.queryBtn) == false) {
    KJ_flag.value = false
  }
})
/*冒溢分析  */
const showSpill = () => {
  Spill_flag.value = !Spill_flag.value
  Jam_flag.value = false
  KJ_flag.value = false
}
/* 堵塞分析 */
const showJam = () => {
  Spill_flag.value = false
  Jam_flag.value = !Jam_flag.value
  KJ_flag.value = false
}
</script>

<style lang="less" scoped>
.map_list {
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  text-align: center;
  width: 280px;
  .img_map_box {
    height: 56px;
    width: 60px;
    border: 1px solid #80eeff;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    .map_active {
      position: absolute;
      top: 39px;
      width: 58.4px;
      height: 16px;
      background-color: rgb(7, 247, 93);
      opacity: 0.85;
    }
    img {
      vertical-align: baseline;
    }
  }
  .img_map_box > img {
    width: 100%;
    height: 100%;
  }
}
.map_list > div {
  margin-top: 7px;
}
.list_title {
  height: 25px;
  border-bottom: 2px solid #72ed5c;
  font-weight: 600;
  font-size: 15px;
  color: #80eeff;
}
</style>
